<?php
namespace control;
// 模具核减
class moldReductionClass extends adIndexClass
{
    private const page        = 'moldReduction';
    private const table       = 'mold_disarmament';
    private const title       = '模具核减';

    /**
     * 字段初始化
     */
    public function fieldInit($fun): array
    {
        switch ($fun) {
            default:
                $tr = [
                    'orderDate'          => [
                        'name'  => "核减日期",
                        'width' => 150,
                        'sort' => 1,
                    ],
                    'code'  => [
                        'name'  => '模具编号',
                        'width' => 150,
                    ],
                    'name'  => [
                        'name'  => '名称',
                        'width' => 200,
                    ],
                    'factory'  => [
                        'name'  => '厂家',
                        'width' => 200,
                    ],
                    'model'         => [
                        'name'  => '规格型号',
                        'width' => 150,
                    ],
                    'money'          => [
                        'name'  => '核减数量',
                        'width' => 100,
                    ],
                    'text'          => [
                        'name'  => "备注",
                        'width' => 200,
                    ],
                    'reason'          => [
                        'name'  => '核减原因',
                        'width' => 200,
                    ],
                    'orderNo'          => [
                        'name'  => '核减单号',
                        'width' => 150,
                        'sort' => 1,
                    ]
                ];
        }
        return $tr;
    }

    /*列表页-查询条件*/
    public function homeOptions($isAsync = true)
    {
        //生成查询表单
        $html = $this->tableShow([
            [
                [
                    "模具编号"   => text(array("name" => "code")),
                    "名称"   => text(array("name" => "name")),
                    "核减原因"   => select(['name' => "reason", 'option' => explode('，', para('moldDisarmamentReason'))]),
                ],
                [
                    "核减单号"   => text(array("name" => "orderNo")),
                    "核减日期" => text(['name' => 'orderDate', 'laydate' => ['range' => '~', 'type' => 'date']]),
                ]
            ]
        ],1);
        //返回
        if (!$isAsync) {
            return $html;
        } else {
            return json_encode(['html' => $html], 320);
        }
    }

    /**
     * 列表-查询条件
     *
     * @return string
     */
    public function home(): string
    {
        $html = $this->homeOptions(false);
        //控件
        $button = "";
        $url = root . "control/adIndex.html?cla=" . self::page;
        if ($this->power(self::page, "edit")) {
            $button .= "<span onclick=\"layer('".self::page."','edit')\" class='spanButton'>新增</span>\n";
        }
        if ($this->power(self::page, "del")) {
            $button .= "<span class='spanButton' onclick=\"layer('{$this->get('cla')}', 'operate', {'act': 'del'})\">删除</span>\n";
        }

        if ($this->power(self::page, "export")) {
            $button .="<span class='spanButton' onclick=\"layer('importTemplate','exportFrame',{cla:'".self::page."'})\">导出</span>";
        }
        //返回
        return $this->homeFun($this->search($html, layout: 'pop', toolButton: $button));
    }

    /**
     * 客户列表-查询结果
     *
     */
    public function homeSearch(): string
    {
        $where = '';
        //查询结果
        $equal       = [
            'coid' => self::$coid,
            'targetTable'=>'mold',
        ];
        $like        = [
            'reason'  => $this->post('reason'),
            'orderNo' => $this->post('orderNo'),
        ];
        $targetWhere = search([
            "like" => [
                'code' => $this->post('code'),
                'name' => $this->post('name'),
            ],
        ]);
        if ($targetWhere) {
            $where .= " and targetId IN (SELECT id FROM mold WHERE 1=1 $targetWhere) ";
        }
        //生成查询语句
        $where .= search([
            "="    => $equal,
            "like" => $like,
        ]);
        if ($this->post('orderDate')) {
            $where .= self::timeComparison($this->post('orderDate'), 'date', 'orderDate');
        }
        //排序
        $orderBy = $this->listSort(array(
            "search"  => $this->post('list_sort_key') ?: 'orderDate desc,time',
            "sort" => $this->post('list_sort') ?: "desc",
            "array"   => array(),
        ));
        $page                        = $this->page(["table" => self::table, "where" => $where, "order" => $orderBy['orderBy']]);
        $_SESSION[self::page]['sql'] = $page['sql'];
        //获取自定义字段参数
        $installSearch = $this->installSearch();
        $body          = [];
        //表格控件区
        $liButton = array(
            $this->checkAll("listForm", "listId")
        );
        //获取记录
        $url = root . "control/adIndex.html?cla=" . self::page;
        foreach ($page['array'] as $array) {
            //列表控件
            $dominate = [
                "box"    => ["name" => "listId", "value" => $array['id']],
                "detail" => ["title" => self::title . "详情", "click" => "newIframe('" . self::title . "详情','" . $url . "&fun=detail&id=" . $array['id'] . "')"],
                "edit"   => $array['state'] === '制单' ? ["title" => "编辑", "click" => "layer('" . self::page . "','edit',{id:'" . $array['id'] . "'})"] : [],
            ];
            $target   = query($array['targetTable'], " id = '{$array['targetId']}' ");
            $liButton[] = $this->dominate($dominate);
            //本行初始化
            $row = [];
            foreach ($installSearch['key'] as $key) {
                switch ($key) {
                    case 'code':
                    case 'name':
                    case 'factory':
                    case 'model':
                        $row[] = $target[$key];
                        break;
                    case 'money':
                        $money    = 1;
                        $row[] = $money;
                        break;
                    default:
                        $row[] = isset($array[$key]) && $array[$key] ? $array[$key] : '';
                }
            }
            $body[] = $row;
        }
        $totalQuery = find([
            'table'  => self::table,
            'single' => $where,
            'field'  => "ifnull(count(id),0) as money",
        ]);
        $total    = [
            'money'        => self::lostZero($totalQuery['money'], 'numPrecision'),
        ];
        //生成页面
        $li = $this->li(array(
            "body" => $body,
            "install" => $installSearch,
            "button" => array("html" => $liButton),
            "orderBySign" => $orderBy,
            "page" => $page['para'],
            "total"       => $total,
        ));
        //返回
        $json['html'] = $page['hint'] . "<form name='listForm'>" . $li . "</form>" . $page['button'] . clear;
        return json_encode($json, 320);
    }


    /**
     * 编辑页
     *
     * @return string
     */
    public function edit()
    {
        $id       = $this->post('id');
        $info     = query(self::table, " coid = '" . self::$coid . "' AND id = '" . $id . "' ");
        $moldName = '请选择';
        if (!static::isNull($info['targetTable'])) {
            $target   = query($info['targetTable'], " id = '$info[targetId]' ");
            $moldName = $target['code'] . '-' . $target['name'] . '-' . $target['model'];
        }
        //表单
        $html = $this->layerEdit([
            "table" => [
                [
                    must . '模具' => hidden(['name' => 'targetId', 'value' => $info['targetId']])
                        . hidden(['name' => 'target', 'value' => $info['targetTable']])
                        . '<span id="moldName"  style="max-width: 80%;" class="exceed-ellipsis">' . $moldName . '</span>'
                        . "<span class='del-row-button' onclick=\"layer('{$this->get('cla')}','addTarget',{})\" style='margin-left: 10px'>选择</span>",
                ],
                [
                    must . '核减日期' => text(['name' => "orderDate", 'class' => 'text', 'value' => $info['orderDate'] ?: $this->date, 'laydate' => [],]),
                    must . '核减原因' => select(['name' => "reason", 'class' => 'text', 'value' => $info['reason'], 'option' => explode('，', para('moldDisarmamentReason'))]),
                ],
                [
                    '备注' => textarea(['name' => "text", 'class' => 'text', 'value' => $info['text']]),
                ],

            ],
            'hidden' => hidden(['name' => 'id', 'value' => $id]),
        ]);
        $html .= <<<EOT
		<script>
		//选择明细
        function addTarget(){
            $.post(root+'control/adIndex.html?cla={$this->get('cla')}&fun=addTargetEdit', $("form[name='mxForm']").serialize(),function(resp) {
	         if (resp.warn === 2){
	            $("[name='targetId']").val(resp.res.targetId);
                $("[name='target']").val(resp.res.target);
	            $("#moldName").html(resp.res.name);
	         }else{
	             msg(resp.warn);
	         }
	        },'json');
        }
        
		</script>
EOT;
        //返回
        return $this->layer(array("title" => L('job.button.editor').self::title, "height" => 350, "html" => $html));
    }

    /**
     *选择生产模具
     *
     * @return bool|string
     */
    public function addTarget(): bool|string
    {
        $html   =
            text(["name" => "type", "title" => "分类",]) .
            text(["name" => "code", "title" => "模具编码"]) .
            text(["name" => "moldName", "title" => "模具名称"]) .
            text(["name" => "model", "title" => "规格型号"]);
        $button = "<input style='margin-left: 5px' onclick=\"addTarget();$('#" . self::page . "AddTarget').hide()\" type='button' class='searchSub' value='提交'>";

        $html = $this->search($html);
        return $this->layer(["title" => "添加", "height" => 600, "width" => 1050, "html" => $html, "button" => $button]);
    }

    /**
     *添加模具
     */
    public function addTargetSearch(): bool|string
    {
        $table = 'mold';
        $state ='启用';
        $like  = [
            'name'  => $this->post('moldName'),
            'code'  => $this->post('code'),
            'model' => $this->post('model'),
            'type'  => $this->post('type'),
        ];
        $equal = [
            'state' => $state,
            'coid'  => self::$coid,
        ];
        $where = search(["like" => $like, "=" => $equal]);
        $page  = $this->page([
            "table" => $table,
            "where" => $where,
            "order" => "time ASC",
        ]);
        //获取表头
        $tr[] = ['', '分类', '编码', '模具名称', '规格型号'];
        //获取记录
        foreach ($page['array'] as $array) {
            $tr[] = array(
                "<input name='mxId' value='$array[id]' type='radio' class='radio-bigger'>",
                $array['type'],
                $array['code'],
                $array['name'],
                $array['model'],
            );
        }
        $json['html'] = $page['hint'] .
            "<form name='mxForm'>" .
                hidden(['name' => 'target', 'value' => $table]) .
                $this->tableMany(array("tr" => $tr, "showSort" => true, "page" => $page['para'])) .
            "</form>" .
            $page['button'];
        return json_encode($json, 320);
    }

    /**
     * 编辑
     *
     * @return bool|string
     */
    public function addTargetEdit(): bool|string
    {
        $targetId = $this->post('mxId');
        if (!$this->power(self::page, 'edit')) {
            $json['warn'] = '你还没有编辑权限';
        } elseif (empty($targetId)) {
            $json['warn'] = '请选择模具';
        } else {
            $mold = query('mold', "id = '$targetId' ");
            $json = [
                'warn' => 2,
                'res'  => [
                    'name'     => $mold['code'] . '-' . $mold['name'] . '-' . $mold['model'],
                    'targetId' => $mold['id'],
                ],
            ];
        }
        return json_encode($json, 320);
    }


    /**
     * 编辑报错
     *
     * @return bool|string
     */
    public function editEdit(): bool|string
    {
        $id         = $this->post('id') ?: self::getId();
        $field      = [
            'targetTable' => 'mold',
            'targetId'    => $this->post('targetId'),
            'orderDate'   => $this->post('orderDate'),
            'reason'      => $this->post('reason'),
            'text'        => $this->post('text'),
        ];
        $annotation = [
            'targetTable' => '对象表',
            'targetId'    => '对象ID',
            'orderDate'   => '单据(核减)日期',
            'reason'      => '核减原因',
        ];
        $rules      = [
            'targetTable' => 'required',
            'targetId'    => 'required',
            'orderDate'   => 'required',
            'reason'      => 'required',
        ];
        // 校验是否符合规则
        $vt     = new \verify();
        $result = $vt->setAliases($annotation)->validate($field, $rules)->isOk();
        if ($result === false) {
            $json['warn'] = $vt->getErrs()[0]; // 多个规则提示最前面一条
            goto resp;
        }
        $where = " id = '$id' ";
        $info  = query(self::table, $where);
        //判断
        if (!$this->power(self::page, "edit")) {
            $json['warn'] = "你没有编辑" . self::title . "的权限";
        } elseif (!empty($info['id']) && $info['state'] == '已审核') {
            $json['warn'] = '此核减单已审核，不能修改';
        } else {
            $this->startTrans();
            $isPass = true;//事务通过标志
            if (!$info['id']) {
                $orderNo      = codeTemplateClass::generateCode(self::page,[
                    'prefix' => 'FAOU' . date('Ymd'),
                    'table'  => self::table,
                    'field'  => 'orderNo',
                    'where'  => " AND coid = '" . self::$coid . "' ",
                ],$field);
                $field        = array_merge($field, [
                    'id'           => $id,
                    'orderNo'      => $orderNo,
                    'state'        => '制单',
                    'departmentId' => $this->controlJob['departmentId'],
                    'coid'         => self::$coid,
                    'stid'         => $this->control['stid'],
                ]);
                $json['warn'] = static::insert(["table" => self::table, "field" => $field]);
            } else {
                $json['warn'] = static::update([
                    "table" => self::table,
                    "field" => $field,
                    "where" => $where,
                ]);
            }

            if (in_array($json['warn'], ["新增成功", "更新成功"]) && $isPass) {
                $this->commitTrans();
                //添加日志
                $type = mb_substr($json['warn'], 0, 2, 'utf-8');
                $text = $this->control['name'] . $type . "了" . self::title . " id：【" . $id . '】';
                $this->logText(["type" => self::page, "text" => $text]);
                //返回
                $_SESSION['warn'] = $json['warn'];
                $json['warn']     = 2;
                $json['href']     = root . "control/adIndex.html?cla=" . $this->get('cla') . "&fun=detail&id=" . $id;
            } else {
                $this->rollback();
            }
        }

        resp:
        return json_encode($json, 320);
    }


    /*详情页*/
    public function detail(): string
    {
        $info = query(self::table, " coid = '" . self::$coid . "' AND id = '{$this->get('id')}'");
        if (empty($info['id'])) {
            $html = '未找到此' . self::title;
        } else {
            $target = query($info['targetTable'], " id = '$info[targetId]' ");
            //菜单
            $data   = ["id" => $info['id'],];
            $button = [];
            if ($info['state'] == '制单') {
                //按钮
                $button[] = [
                    "name"  => "编辑",
                    "type" => "弹出层",
                    "cla" => $this->get('cla'),
                    "fun" => "edit",
                    "post" => ["id" => $info['id']],
                    // 'style' => 'li-btn-blue-bg',
                ];
                //按钮
                $button[] = [
                    "name" => "删除",
                    "type" => "弹出层",
                    "cla"  => $this->get('cla'),
                    "fun"  => "operate",
                    "post" => ["act" => 'del', "id" => $info['id']],
                ];
            }
            $button = array_merge($this->auditButton($info),$button);

            //生成表单
            $data['button'] = $this->tableShowButton($button);
            $data['html'] = $this->tableShow([
                '基本信息' => [
                    [
                        "模具" => $target['code'] . ' - ' . $target['name'] . ' - ' . $target['model'],
                        "核减原因" => $info['reason'],
                        "核减日期" => $info['orderDate'],
                    ],
                    [
                        "备注" => pre($info['text']),
                    ],
                ],
                '系统信息'   => [
                    [
                        "单据编号"  => $info['orderNo'],
                        "申请人部门" => self::findStaffDepartment($info['stid']),
                        "申请人"   => self::findStaff($info['stid']),
                        "创建时间" => $info['time'],
                    ],
                    [
                        "更新时间" => $info['updateTime'],
                        "状态"   => $info['state']
                    ],
                ],
                '流程'     => [
                    [
                        auditClass::auditRecord(self::table, $info['id']),
                    ],
                ],
            ]);
            //生成页面
            $html = $this->tab($data);
        }
        //返回
        return $html;
    }

    /**
     * 审核按钮
     *
     * @param $info
     * @return array
     */
    public function auditButton($info): array
    {
        $button = [];
        if ($info['state'] == '制单'  || auditClass::auditFlag(self::table, $info['id'],'selfChoose')) {
            $button[] = [
                "name"  => '提交审批',
                "type"  => "弹出层",
                "cla"   => 'audit',
                "fun"   => "operate",
                'style' => 'li-btn-blue-bg',
                "post"  => [
                    "act"  => 'start',
                    "id"   => $info['id'],
                    'body' => self::encryptDecrypt(
                        json_encode([
                            'name'    => self::title,
                            'table'   => self::table,
                            'process' => [
                                // 预览函数
                                'detail' => [
                                    'cla' => $this->get('cla'),
                                    'fun' => 'detail',
                                ],
                                // 保存函数
                                'save'   => [
                                    'cla' => $this->get('cla'),
                                    'fun' => 'editPageEdit',
                                ],
                                //执行发起时验证函数
                                'before' => [
                                    'cla' => $this->get('cla'),
                                    'fun' => '',
                                ],
                                //完成发起后执行函数
                                'after'  => [
                                    'cla' => $this->get('cla'),
                                    'fun' => '',
                                ],
                            ],
                        ], 320)
                    ),
                ],
            ];
        }
        // 审批并判断是否有权限
        if ($info['state'] == '审核中' && auditClass::auditFlag(self::table, $info['id'])) {
            $button[] = [
                "name" => '添加审批人',
                "type" => "弹出层",
                "cla"  => 'audit',
                "fun"  => "operate",
                "post" => [
                    "act"  => 'addApprover',
                    "id"   => $info['id'],
                    'body' => self::encryptDecrypt(
                        json_encode([
                            'table' => self::table,
                        ], 320)
                    ),
                ],
            ];
            $button[] = [
                "name" => '转交',
                "type" => "弹出层",
                "cla"  => 'audit',
                "fun"  => "operate",
                "post" => [
                    "act"  => 'transfer',
                    "id"   => $info['id'],
                    'body' => self::encryptDecrypt(
                        json_encode([
                            'table' => self::table,
                        ], 320)
                    ),
                ],
            ];
            $button[] = [
                "name"  => '审批',
                "type"  => "弹出层",
                "cla"   => 'audit',
                "fun"   => "operate",
                // 以下参数固定格式
                "post"  => [
                    "act"  => 'approval',
                    "id"   => $info['id'],
                    'body' => self::encryptDecrypt(
                        json_encode([
                            'table'   => self::table,
                            // 当前状态
                            'state'   => $info['state'],
                            // 变更
                            'field'   => ['state'],   //变更字段 可多个
                            'value'   => [
                                'state' => ['制单', '已通过'],
                            ],
                            // 审核时回调
                            'process' => [
                                //执行首次审核时验证
                                'before' => [
                                    'cla' => $this->get('cla'),
                                    'fun' => '',
                                ],
                                //执行末次审核后处理
                                'after'  => [
                                    'cla'  => $this->get('cla'),
                                    'fun'  => 'useDone',
                                    'data' => ['id' => $info['id']],
                                ],
                            ],
                        ], 320)
                    ),
                ],
                'style' => 'li-btn-blue-bg',
            ];
        }

        // 撤销审批
        if (auditClass::auditFlag(self::table, $info['id'], 'cancel') && $info['state'] != '制单') {
            $button[] = [
                "name" => '撤销审批',
                "type" => "弹出层",
                "cla"  => 'audit',
                "fun"  => "operate",
                "post" => [
                    "act"  => 'cancel',
                    "id"   => $info['id'],
                    'body' => self::encryptDecrypt(
                        json_encode([
                            'table'   => self::table,
                            // 当前状态
                            'state'   => $info['state'],
                            // 变更
                            'field'   => ['state'],   //变更字段 可多个
                            'value'   => [
                                'state' => ['制单'],
                            ],
                            'process' => [
                                //完成发起后执行函数
                                'after' => [
                                    'cla' => $this->get('cla'),
                                    'fun' => '',
                                ],
                            ],
                        ], 320)
                    ),
                ],
            ];
        }
        return $button;
    }

    /**
     * 最后确认操作
     *
     * @param array $data
     * @return void
     */
    public function useDone(array $data)
    {
        $id   = $data['id'];
        $info = query(self::table, " id = '$id' ");
        if ($info['targetTable']) {
            static::update([
                'table' => $info['targetTable'],
                'field' => [
                    'state' => '已核减',
                ],
                'where' => " id = '{$info['targetId']}' ",
            ]);
        }
    }


    // 操作中转
    public function operate()
    {
        $act = $this->post('act') ?? '';
        $pwd = $word = false; // 需要密码
        switch ($act) {
            default:
                $act      = 'del';
                $msg      = '删除' . self::title;
                $title    = self::page . 'Delete';
                $function = 'delete';
                $form     = self::page . 'OperateForm, listForm, quoForm';
                $power    = '';
                break;
        }
        if (!$this->power(self::page, $act)) {
            $_SESSION['warn'] = '你还没有' . $msg . '的权限';
            $json             = [
                'warn' => 2,
                'href' => root . 'control/adIndex.html?cla=' . $this->get('cla') . '&fun=home',
            ];
        } else {
            return $this->confirm([
                'title'    => $title,
                'function' => $function,
                'form'     => $form,
                'power'    => $power,
                'pwd'      => $pwd,
                'word'     => $word,
            ]);
        }

        resp:
        return json_encode($json, 320);
    }

    /**
     * 删除
     *
     * @return bool|string
     */
    public function delete()
    {
        $array = $this->post('listId') ?? $this->post('id');
        if (!$this->power(self::page, "del")) {
            $json['warn'] = "你没有删除的权限";
        } elseif (empty($array)) {
            $json['warn'] = "你一个数据都没有选择呢";
        } else {
            $text  = "";
            $x     = 0;
            $array = is_array($array) ? $array : [$array];
            foreach ($array as $id) {
                $info = query(self::table, " coid = '" . self::$coid . "' AND id = '$id' ");
                if ($info['state'] == '已审核') {
                    $warn = "删除失败：已审核，暂不能删除";
                } else {
                    //最后删除基本参数
                    delete(array("table" => self::table, "where" => " id = '$id' "));
                    // delete(array("table" => self::tableMx, "where" => " orderId = '$id' "));
                    delete(array("table" => 'auditing_follow', "where" => " typeId = '$id' "));
                    //返回
                    $warn = "删除成功";
                    $x++;
                }
                $text .= self::title . "ID【" . $info['id'] . "】" . $warn . "。<br>";
            }
            //添加日志
            $text = $this->control['name'] . "删除了" . self::title . "，结果如下：<br>" . $text;
            $this->logText(array("type" => self::page, "text" => $text));
            $_SESSION['warn'] = "删除了" . $x . "个" . self::title . "，详情见系统日志。";
            $json['warn']     = 2;
            $json['href']     = root . "control/adIndex.html?cla=" . $this->get('cla') . "&fun=home";
        }
        return json_encode($json, 320);
    }

    /**
     * 导出
     */
    public function exportData()
    {
        $templateId = $this->get('templateId');
        $checkedId = $this->get('checkedId')?explode(',',$this->get('checkedId')):[];
        if (!$this->power(self::page, 'export')) {
            $_SESSION['warn'] = '你还没有导出的权限';
        }  else {
            $data = [];
            /***********标题**********/
            $title =[];
            $tempFieldAll = importTemplateClass::templateField(self::page, 'exportFieldInit', id:$templateId);
            foreach ($tempFieldAll as $array) {
                if ($array['display']){
                    $title[] = $array['aliasName'];
                }
            }
            //判断是否选中导出
            if (!self::is_null_array($checkedId)){
                $result = find(array(
                    "table" => self::table,
                    "where" => "id in ('".implode("','", $checkedId)."') order by orderDate desc,time desc",
                ))['array'];
            }else{
                $sql   = $_SESSION[self::page]['sql'];
                $result   = sqlFind($sql);
            }
            //导出数据生成
            foreach ($result as $array){
                $column = [];
                $target = query($array['targetTable'], " id = '{$array['targetId']}' ");
                foreach ($tempFieldAll as $templateField){
                    if ($templateField['display']){
                        $column[] = match ($templateField['columnName']){
                            '核减日期'=>$array['orderDate'],
                            '模具编号'=>$target['code'],
                            '名称'=> $target['name'],
                            '厂家'=> $target['factory'],
                            '规格型号'=> $target['model'],
                            '核减数量'=>1,
                            '备注'=>$array['text'],
                            '核减原因'=>$array['reason'],
                            '核减单号'=>$array['orderNo'],
                            default=>'',
                        };
                    }
                }
                $data[] = $column;
            }
            $text = $this->control['name'] . "导出了" . self::title;
            $this->logText(["type" => self::page, "text" => $text]);
            $this->excelOut($title, $data, self::title . ".xlsx");
            exit(0);
        }
        header("Location:" . getenv("HTTP_REFERER"));

    }

    /**
     * 导出模板字段初始化
     * @return array[]
     */
    public function exportFieldInit($classify=''): array
    {
        return match ($classify) {
            default=>  [
                [
                    'columnName'=>'核减日期',
                    'aliasName'=>'核减日期',
                ],
                [
                    'columnName'=>'模具编号',
                    'aliasName'=>'模具编号',
                ],
                [
                    'columnName'=>'名称',
                    'aliasName'=>'名称',
                ],
                [
                    'columnName'=>'厂家',
                    'aliasName'=>'厂家',
                ],
                [
                    'columnName'=>'规格型号',
                    'aliasName'=>'规格型号',
                ],
                [
                    'columnName'=>'核减数量',
                    'aliasName'=>'核减数量',
                ],
                [
                    'columnName'=>'备注',
                    'aliasName'=>'备注',
                ],
                [
                    'columnName'=>'核减原因',
                    'aliasName'=>'核减原因',
                ],
                [
                    'columnName'=>'核减单号',
                    'aliasName'=>'核减单号',
                ],
            ]
        };
    }
}
